home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / os2 / etelr21 / etfixnb.vrm < prev    next >
Text File  |  1994-09-13  |  7KB  |  280 lines

  1. /* Custom mainline for macro */
  2.  
  3.     call RXFuncAdd "VRLoadFuncs", "VROBJ", "VRLoadFuncs"
  4.     call VRLoadFuncs
  5.  
  6.     _VREVersion = SubWord( VRVersion( "VRObj" ), 1, 1 )
  7.     if( _VREVersion < 2.10 )then do
  8.         call VRMessage "", "This program requires VX-REXX version 2.1 to run.", "Error!"
  9.         return 32000
  10.     end
  11.  
  12.     signal on SYNTAX name _VRESyntax
  13.     signal _VREMain
  14.  
  15. _VRESyntax:
  16.     parse source . . _VRESourceSpec
  17.     call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL":" ErrorText(rc), "Error!"
  18.     call VRFini
  19.     exit 32000
  20.  
  21. _VREMain:
  22. /*:VRX         Main
  23. */
  24. /*  Main
  25. */
  26. Main:
  27. /*  Process the arguments.
  28.     Get the parent window.
  29. */
  30.     parse source . calledAs .
  31.     parent = ""
  32.     argCount = arg()
  33.     argOff = 0
  34.     if( calledAs \= "COMMAND" )then do
  35.         if argCount >= 1 then do
  36.             parent = arg(1)
  37.             argCount = argCount - 1
  38.             argOff = 1
  39.         end
  40.     end
  41.     InitArgs.0 = argCount
  42.     if( argCount > 0 )then do i = 1 to argCount
  43.         InitArgs.i = arg( i + argOff )
  44.     end
  45.     drop calledAs argCount argOff
  46.  
  47. /*  Load the windows
  48. */
  49.     call VRInit
  50.     parse source . . spec
  51.     _VREPrimaryWindowPath = ,
  52.         VRParseFileName( spec, "dpn" ) || ".VRW"
  53.     _VREPrimaryWindow = ,
  54.         VRLoad( parent, _VREPrimaryWindowPath )
  55.     drop parent spec
  56.     if( _VREPrimaryWindow == "" )then do
  57.         call VRMessage "", "Cannot load window:" VRError(), ,
  58.             "Error!"
  59.         _VREReturnValue = 32000
  60.         signal _VRELeaveMain
  61.     end
  62.  
  63. /*  Process events
  64. */
  65.     call Init
  66.     signal on halt
  67.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  68.         _VREEvent = VREvent()
  69.         interpret _VREEvent
  70.     end
  71. _VREHalt:
  72.     _VREReturnValue = Fini()
  73.     call VRDestroy _VREPrimaryWindow
  74. _VRELeaveMain:
  75.     call VRFini
  76. exit _VREReturnValue
  77.  
  78. VRLoadSecondary: procedure
  79.     name = arg( 1 )
  80.  
  81.     window = VRLoad( VRWindow(), VRWindowPath(), name )
  82.     call VRMethod window, "CenterWindow"
  83.     call VRSet window, "Visible", 1
  84.     call VRMethod window, "Activate"
  85. return window
  86.  
  87. /*:VRX         Fini
  88. */
  89. Fini:
  90.     window = VRWindow()
  91.     call VRSet window, "Visible", 0
  92.     drop window
  93. return 0
  94.  
  95. /*:VRX         Halt
  96. */
  97. Halt:
  98.     signal _VREHalt
  99. return
  100.  
  101. /*:VRX         Init
  102. */
  103. Init:
  104.     call VRMethod 'Application', 'GetVar', 'args.'
  105.     AcctDir = args.1
  106.     srcRec = args.2
  107.     window = VRWindow()
  108.     call VRMethod window, "CenterWindow"
  109.     call VRSet window, "Visible", 1
  110.     call VRMethod window, "Activate"
  111.     drop window
  112. return
  113.  
  114. /*:VRX         PBDailyHelp_Click
  115. */
  116. PBDailyHelp_Click:
  117. address cmd 'view e-teller Editing Fixed Transactions'
  118. return
  119.  
  120. /*:VRX         PBDailyRefresh_Click
  121. */
  122. PBDailyRefresh_Click:
  123. call VRSet 'PBDailyRefresh', 'Enabled', 0
  124. call VRSet 'MLEDaily', 'Value', ''
  125. call SWDaily_Create
  126. call VRSet 'Window1', 'Pointer', '<default>'
  127. return
  128.  
  129. /*:VRX         PBDailySave_Click
  130. */
  131. PBDailySave_Click:
  132. value = VRGet( 'MLEDaily', 'Value' )
  133. if value = dailyBuff then do
  134.     call VRMessage '', 'Contents have not changed.  '||'0a'x||'No need to save.  ', 'Information'
  135.     return
  136. end
  137. ok = VRDeleteFile( AcctDir||'\et_fix.dat' )
  138. if ok = 0 then do
  139.     call VRMessage 'Screen', VRError(), 'Error'
  140.     return
  141. end
  142. call charout AcctDir||'\et_fix.dat', value
  143. call stream AcctDir||'\et_fix.dat', 'c', 'close'
  144. dailyBuff = value
  145. drop value
  146. return
  147.  
  148. /*:VRX         PBFixedRegen_Click
  149. */
  150. PBFixedRegen_Click:
  151. if( \VRFileExists( 'et_month.exe' ) )then do
  152.     call VRMessage '', 'Unable to locate et_month.exe.  ', 'Error'
  153.     call VRSet 'PBFixedRegen', 'Enabled', 0
  154.     return
  155. end
  156. call VRLoadSecondary 'SWMsg'
  157. 'et_month.exe ETELLER REGENERATE'
  158. call VRDestroy 'SWMsg'
  159. call VRSet 'PBFixedRegen', 'Enabled', 0
  160. call VRSet 'PBDailyRefresh', 'Enabled', 1
  161. return
  162.  
  163. /*:VRX         PBFixedSave_Click
  164. */
  165. PBFixedSave_Click:
  166. value = VRGet( 'MLEFixed', 'Value' )
  167. if value = FixedBuff then do
  168.     call VRMessage '', 'Contents have not changed.  '||'0a'x||'No need to save.  ', 'Information'
  169.     return
  170. end
  171. ok = VRDeleteFile( AcctDir||'\et_fixed.dat' )
  172. if ok = 0 then do
  173.     call VRMessage 'Screen', VRError(), 'Error'
  174.     return
  175. end
  176. call VRSet 'PBFixedRegen', 'Enabled', 1
  177. call charout AcctDir||'\et_fixed.dat', value
  178. call stream AcctDir||'\et_fixed.dat', 'c', 'close'
  179. FixedBuff = value
  180. drop value
  181. return
  182.  
  183. /*:VRX         PFFixedHelp_Click
  184. */
  185. PFFixedHelp_Click:
  186. address cmd 'view e-teller Editing Fixed Transactions'
  187. return
  188.  
  189. /*:VRX         Quit
  190. */
  191. Quit:
  192.     rc = srcRec
  193.     call VRMethod 'Application', 'PutVar', 'rc'
  194.     call VRMethod 'Application', 'PostQueue', 0, 1, 'call end_FixFileEdit'
  195.     window = VRWindow()
  196.     call VRSet window, "Shutdown", 1
  197.     drop window rc args. AcctDir DailyBuff FixedBuff value srcRec
  198. return
  199.  
  200. /*:VRX         SWDaily_Close
  201. */
  202. SWDaily_Close:
  203.     window = VRInfo( "Object" )
  204.     call VRDestroy window
  205.     drop window
  206. return
  207. /*:VRX         SWDaily_Create
  208. */
  209. SWDaily_Create:
  210. if( \VRFileExists( AcctDir||'\et_fix.dat' ) )then
  211.     return
  212. call VRSet 'Window1', 'Pointer', 'Wait'
  213. call VRSet 'MLEDaily', 'Painting', 0
  214. call stream AcctDir||'\et_fix.dat', 'c', 'open'
  215. call stream AcctDir||'\et_fix.dat', 'c', 'seek =1'
  216. dailyBuff = CharIn(AcctDir||'\et_fix.dat',1,Chars(AcctDir||'\et_fix.dat'))
  217. call VRSet 'MLEDaily', 'Value', dailyBuff
  218. call stream AcctDir||'\et_fix.dat', 'c', 'close'
  219. call VRMethod 'Application', 'SendKeyString', 'MLEDaily', '{Ctrl}{Home}'
  220. call VRSet 'Window1', 'Pointer', '<default>'
  221. call VRSet 'MLEDaily', 'Painting', 1
  222. return
  223.  
  224. /*:VRX         SWFixed_Close
  225. */
  226. SWFixed_Close:
  227.     window = VRInfo( "Object" )
  228.     call VRDestroy window
  229.     drop window
  230. return
  231. /*:VRX         SWFixed_Create
  232. */
  233. SWFixed_Create:
  234. if( \VRFileExists( AcctDir||'\et_fixed.dat' ) )then
  235.     return
  236. call VRSet 'Window1', 'Pointer', 'Wait'
  237. call VRSet 'MLEFixed', 'Painting', 0
  238. call stream AcctDir||'\et_fixed.dat', 'c', 'open'
  239. call stream AcctDir||'\et_fixed.dat', 'c', 'seek =1'
  240. FixedBuff = CharIn(AcctDir||'\et_fixed.dat',1,Chars(AcctDir||'\et_fixed.dat'))
  241. call VRSet 'MLEFixed', 'Value', FixedBuff
  242. call stream AcctDir||'\et_fixed.dat', 'c', 'close'
  243. call VRMethod 'Application', 'SendKeyString', 'MLEFixed', '{Ctrl}{Home}'
  244. call VRSet 'MLEFixed', 'Painting', 1
  245. call VRSet 'Window1', 'Pointer', '<default>'
  246. return
  247.  
  248. /*:VRX         SWMsg_Close
  249. */
  250. SWMsg_Close:
  251.     window = VRInfo( "Object" )
  252.     call VRDestroy window
  253.     drop window
  254. return
  255. /*:VRX         Window1_Close
  256. */
  257. Window1_Close:
  258.     call Quit
  259. return
  260.  
  261. /*:VRX         Window1_Create
  262. */
  263. Window1_Create:
  264. if( \VRFileExists( AcctDir||'\et_fix.dat' ) )then
  265.     call VRMethod "NBFixedFiles", "DeletePage", "1" 
  266. else
  267.     call VRMethod "NBFixedFiles", "SetStatusText", "1", "Filename:  et_fix.dat"
  268. if( \VRFileExists( AcctDir||'\et_fixed.dat' ) )then
  269.     call VRMethod "NBFixedFiles", "DeletePage", "2"
  270. else
  271.     call VRMethod "NBFixedFiles", "SetStatusText", "2", "Filename:  et_fixed.dat"
  272. return
  273.  
  274. /*:VRX         Window1_Help
  275. */
  276. Window1_Help: 
  277. address cmd 'view e-teller Editing Fixed Transactions'
  278. return
  279.  
  280.